{% extends 'QuestionPlusBundle:QuestionPlumber:layout.html.twig' %}

{% set side_nav = 'question_plumber' %}
{% set script_controller = 'questionplusbundle/controller/question-plumber/export' %}

{% block type %}

{% if not questionPlusSetting.enabled %}
  <div class="empty">导出功能未开启</div>
{% else %}

  <form class="form-horizontal" id="question-export-form" method="post" action="{{ path('question_export', {courseId:course.id}) }}" target="_blank">

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="type">选择导出范围</label>
      </div>
      <div class="col-md-8 controls">
        <select class="form-control width-input width-input-large" name="target" data-role="target">
          {{ select_options(targetsChoices) }}
        </select>
        <div class="help-block">可以导出本课程或者某个课时的题目</div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="file">选择导出题型</label>
      </div>
      <div class="col-md-8 controls">
        <select class="form-control width-input" name="type">
          {{ select_options(dict('questionType'), null, '--所有题型--') }}
        </select>
      </div>
    </div>

    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">

    <div class="form-group">
      <div class="col-md-offset-2 col-md-8 controls">
        <button class="btn btn-fat btn-primary" id="question-export-btn" type="submit">导出</button>
      </div>
    </div>

  </form>

{% endif %}

{% endblock %}
